﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using nGSO;

namespace nGSO.Tests
{
    [TestFixture]
    public class MaximumProbabilitySelectorTester
    {
        [Test]
        public void SampleMovementTest()
        {
            MaximumProbabilitySelector selector = new MaximumProbabilitySelector();
            List<Agent> neighbours              = new List<Agent>();
            Agent agent                         = new Agent() { Loc = new double[] { 1, 1 }, Neighbors = neighbours, Luciferin = 12 };

            Agent neighbour1 = new Agent() { Luciferin = 5 }; // 5 - 12 = -7 | -7/20
            Agent neighbour2 = new Agent() { Luciferin = 1 }; // 1 - 12 = - 11 | -11/20
            Agent neighbour3 = new Agent() { Luciferin = 50 }; // 50 - 12 = 38 | 38/20
                                                                    // 20

            neighbours.Add(neighbour1);
            neighbours.Add(neighbour2);
            neighbours.Add(neighbour3);

            Assert.AreSame(selector.GetAgentToMoveToward(agent), neighbour3);
        }
    }
}
